//=========================================================================
// Copyright (C) 2025 The C++ Component Model(COMO) Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================

#ifndef __VOTER_CUSTOMIZED_H__
#define __VOTER_CUSTOMIZED_H__

#include <stddef.h>
#include <linux/limits.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C"
{
#endif

int MyVoterOutputMsg(char *s, size_t len, int outputTokenOrder, uint64_t token,
                                                                   void *trans);
int MyVoterPhxPaxosCheckkeyCallback(const char *pBuf, size_t sizeBuf);

#ifdef SYNC_WITH_PHXPAXOS
    #include "PhxPaxosC.h"

    int PreparePhxPaxos(PhxPaxosSmCallback callback, void *userData);

    int MyVoterPhxPaxosSmCallback(int32_t action, const char *key, size_t keySize,
                                            const char *value, size_t valueSize,
                                            char **buf, size_t *bufSize,
                                            int32_t *defaultAction,
                                            void *userData);

    int MyPhxPaxosMasterChangeCallback(void);
#endif
extern void *g_oPaxosServer;

#ifdef __cplusplus
}
#endif

#endif // __VOTER_CUSTOMIZED_H__
